package com.sp2.dev.test.singletion;

/**
 * Created by IntelliJ IDEA.
 * User: zhimingli
 * Date: 14-1-23
 * Time: 下午5:47
 * To change this template use File | Settings | File Templates.
 */
public class LazySingleton {
    private static LazySingleton lazySingleton = null;

    private LazySingleton() {

    }

    //  public synchronized static LazySingleton getInstance()
    //可加synchronized线程安全
    
    public synchronized static LazySingleton getInstance() {
        if (lazySingleton == null) {
            lazySingleton = new LazySingleton();
        }
        return lazySingleton;
    }
}
